package com.lh.api.controller.index;

import com.lh.api.controller.AbstractController;
import com.lh.api.service.BannerService;
import com.lh.api.vo.BannerVo;
import com.lh.common.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gze
 * @ClassName: BannerAction
 * @Description: banner相关接口
 * @date: 2020-05-14 14:09
 */
@RestController
@RequestMapping("/api/banner")
@Api(value="BannerAction",tags={"banner相关接口"})
public class BannerAction extends AbstractController {

    @Autowired
    private BannerService bannerService;

    @ApiOperation(value = "查询轮播图")
    @GetMapping("/rotationBanner")
    public Result<List<BannerVo>> rotationBanner(){
        List<BannerVo> bannerVos =   bannerService.rotationBanner();
        return Result.ok(bannerVos);
    }

    @ApiOperation(value = "查询一元夺宝banner")
    @GetMapping("/oneBanner")
    public Result<BannerVo> oneBanner(){
        BannerVo bannerVo = bannerService.oneBanner();
        return Result.ok(bannerVo);
    }
}
